package com.gitee.empty_null.pojo;

import lombok.Data;

/**
 * @author xuhainan
 * @date 2023/11/24 09:37
 * @region hefei
 */
@Data
public class Result<T> {

    private int code;
    private String message;
    private T data;

    public static <T> Result<T> success() {
        return success(null);
    }

    public static <T> Result<T> success(T data) {
        return success(200, "success", data);
    }

    public static <T> Result<T> success(int code, String message, T data) {
        return new Result<>(code, message, data);
    }


    public Result(int code, String message, T data) {
        this.code = code;
        this.message = message;
        this.data = data;
    }


}
